/*
** commade2.c for my_irc in /home/billey_b/projet/my_irc/my-irc-a
** 
** Made by Bastien Billey
** Login   <billey_b@epitech.net>
** 
** Started on  Tue Apr 17 14:35:57 2012 Bastien Billey
** Last update Tue Apr 17 14:35:59 2012 Bastien Billey
*/

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "client.h"

void	users(t_client * client)
{
 xsend(sock_client, client->cmd.buff, strlen(client->cmd.buff), 0);
}

void	msg(t_client *client)
{
  parse_addr_and_port(client);
  if (strlen(client->cmd.arg1) < 1 || strlen(client->cmd.arg2) < 1)
    printf("usage /msg [USER] [MESSAGE]\n");
  else
    xsend(sock_client, client->cmd.buff, strlen(client->cmd.buff), 0);
}

void	send_file(t_client *client)
{
  parse_addr_and_port(client);
  if (strlen(client->cmd.arg1) < 1 || strlen(client->cmd.arg2) < 1)
    printf("usage /send_file [USER] [FILE]\n");
  else
    printf("ca va envoyer : %s a %s\n", client->cmd.arg2, client->cmd.arg1);
}

void	accept_file(t_client *client)
{
  parse_addr_and_port(client);
  if (strlen(client->cmd.arg1) < 1)
    printf("faut dire un nick\n");
  else
    printf("fichier accepter de %s\n", client->cmd.arg1);
}

void	help_cmd(t_client *client)
{
  (void)client;
  printf("command list\n");
  printf("/server [HOST] [PORT]\n");
  printf("/nick [NICKNAME]\n");
  printf("/list [STRING]\n");
  printf("/join [CHANNEL]\n");
  printf("/part [CHANNEL]\n");
  printf("/users\n");
  printf("/msg [NICKNAME] [MESSAGE]\n");
  printf("/send_file [NICKNAME] [FILE]\n");
  printf("/accept_file [NICKNAME]");
}
